#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <interface.h>
#include <sys/ioctl.h>

void delay()
{	
	int i = 1000000;
	while (i--);
}


void set_led(unsigned int cmd)
{
	int fd = open("/dev/led_dev0", O_RDWR);
	if (fd == -1 ) {
		perror("open");
		printf("error: can't open file /dev/led_dev\n");
	}
	if(1==cmd)
	{
		ioctl(fd,LED_L);
	}
	else
		ioctl(fd,LED_D);

	close(fd);	
}

